<script>
import { getNum } from './api'
export default {
  name: '',
  components: { List: () => import('./List.vue') },
  data() {
    return {
      num: 0,
    }
  },
  computed: {},
  watch: {},
  created() {
    this.getNum()
  },
  mounted() {},
  methods: {
    getNum() {
      getNum().then(({ data }) => {
        this.num = data
      })
    },
  },
}
</script>

<template>
  <van-tabs>
    <van-tab :title="`未读消息(${num})`" name="0">
      <List type="unread"></List>
    </van-tab>
    <van-tab title="已读" name="1">
      <List type="read"></List>
    </van-tab>
  </van-tabs>
</template>

<style lang="less" scoped></style>
